package com.hqyj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.hqyj.pojo.Tabless;
import com.hqyj.dao.TablessMapper;
import com.hqyj.service.ITablessService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 桌位表 服务实现类
 * </p>
 *
 * @author rock
 * @since 2021-10-21
 */
@Service
public class TablessServiceImpl implements ITablessService {
    @Autowired
    TablessMapper tablessMapper;

    @Override
    public HashMap<String, Object> queryAll(Tabless tabless) {
        HashMap<String,Object> map = new HashMap<>();
        QueryWrapper queryWrapper = new QueryWrapper();
        List<Tabless> tablessList = tablessMapper.selectList(null);
        System.out.println(tablessList);
        map.put("list",tablessList);
        return map;
    }

    @Override
    public int updateByTable(Tabless tabless) {
        int update = tablessMapper.update(tabless,null);
        return 0;
    }

    @Override
    public int addTabless(Tabless tabless) {
        int insert = tablessMapper.insert(tabless);
        return insert;
    }
}
